package com.lhh.myspringboot.test;

import java.util.Scanner;

public class He {

    public static void main(String[] args) {

        /*
        A+B(1)
         */
       /* Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){

                int i = scanner.nextInt();
                int j = scanner.nextInt();
                System.out.println(i + j);


        }*/

       /*
       A+B(2)
        */
        /*Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        for (int j = 0; j < i; j++) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            System.out.println(a + b);
        }*/

         /*
       A+B(3)
        */

        /*Scanner scanner = new Scanner(System.in);

        while(scanner.hasNext()){

            int i = scanner.nextInt();
            int j = scanner.nextInt();
            if (i==0 && j==0){
                break;
            }
            System.out.println(i + j);
            continue;
        }*/


         /*
       A+B(4)
        */

        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            if (n==0){
                break;
            }else{
                int num = 0;
                for (int i = 0; i < n; i++) {
                    int a = scanner.nextInt();
                    num = num + a;
                }
                System.out.println(num);
                continue;
            }

        }

    }
}
